package com.jy.datapipeline.importserver.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.*;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ImportTaskLog implements Serializable, BasicEntity {

    private static final long serialVersionUID = -6296312890084320147L;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    private String taskLogId;

    private String subtaskId;

    private String filePath;

    private String fileName;

    private String fileSize;

    private String fileRecordRows;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date endTime;

    private Date deleteTime;

    private String errorMsg;

    private String taskStatus;

    //=======以下是外部字段========

    private String taskId;

    private String targetTableName;

    private Date circleTime;

    private String ctlContext;

    private String tnsUrl;

    private Integer expCode;

    @SneakyThrows
    @Override
    public BasicEntity createClone() {
        return (BasicEntity) clone();
    }
}